﻿namespace Searcher
{
    public class MatchsItem
    {
        public MatchsItem(string fileName, List<string> matchs)
        {
            FileName = fileName;
            Matchs = matchs;
        }

        public string FileName { get; set; }
        public List<string> Matchs { get; set; }

        public override string ToString()
        {
            return $"{FileName} [{Matchs.Count}条]";
        }
    }

    public class MatchItem
    {
        public string Value { get; set; }

        public MatchItem(string value)
        {
            Value = value;
        }

        public override string ToString()
        {
            int max = 60;
            if (Value.Length < max) return Value;
            else return Value.Substring(0, max) + "...";
        }
    }
}